# -- encoding: utf-8 --
# Copyright (c) 2024 Huawei Technologies Co., Ltd. All Rights Reserved.
# This file is a part of the ModelEngine Project.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ======================================================================================================================
"""
功 能：Fit框架和框架相关插件常量
"""
DEFAULT_CODECS = 'utf-8'

STARTUP_PLUGINS_KEY = 'plugins'
STARTUP_PLUGINS_BOOTSTRAP_KEY = 'bootstrap'
STARTUP_PLUGINS_SYSTEM_KEY = 'system'
STARTUP_PLUGINS_USER_KEY = 'user'
STARTUP_PLUGINS_LOCATION_KEY = 'location'

FIT_META_GEN_KEY = 'genericables'
FIT_META_GEN_FITABLES_KEY = 'fitables'
FIT_META_ROUTE_KEY = 'route'  # optional
FIT_META_TAGS_KEY = 'tags'  # optional
FIT_META_TRUST_KEY = 'trust'  # optional
FIT_META_ALIASES_KEY = 'aliases'

FIXED_GENERICABLE_VERSION = '1.0.0'
FIXED_FITABLE_VERSION = '1.0.0'

GEN_CONF_NODE_KEY_PREFIX = 'fit.public.genericables.'
PLUGIN_CONF_NODE_KEY_PROP = 'configurecenter.path'
GENERICABLE_CONFIGURATION_CENTER_ROOT_PROP = 'genericable.rootpath'

# Runtime配置目录（程序入参）
CONFIG_FOLDER_ARG_NAME = 'config_folder'

# Fit底座根目录的参数名
STARTUP_FRAMEWORK_FOLDER_KEY = 'framework_folder'

# 全局插件名
GLOBAL_PLUGIN_NAME = "__global__"

# debugger 线程是否已经启动
DEBUGGER_CONSOLE_ACTIVE = "debugger_console_active"

# plugin generic ids and fitable ids #
# bootstrap
BOOTSTRAP_START_GEN_ID = 'd087020c54ea44e3a8a893e5fbc2959e'
BOOTSTRAP_START_FIT_ID = 'ed770dde7be44cf18fe0ebe2fc7a773d'
BOOTSTRAP_CLEANUP_GEN_ID = 'f4699ad499dd47a3a267b6188f0f4e53'
BOOTSTRAP_CLEANUP_FIT_ID = '2a93dc184b4f4bacbc5299c5f995783d'
BOOTSTRAP_LOGO_FIT_ID = '81347a377d2340d582a0ecb31365e079'

# configuration repo
FIT_METADATA_LOAD_GEN_ID = 'fcb6051fc6ef43e6ae48bf5e3b7b3363'
FIT_METADATA_LOAD_FIT_ID = 'c4d9eb7ae8564f5f864d1fb27fb79de1'
FIT_PLUGIN_CONFIGURATION_LOADER_GEN_ID = '6b1625fa1e754a449daa08d32d7cfae2'
FIT_PLUGIN_CONFIGURATION_LOADER_FIT_ID = 'b2cec0cd7e5b4dae9f0c19ac4d693f1c'
FIT_PLUGIN_CONFIGURATION_UNLOAD_GEN_ID = '625fa1e75cdaa08d3fb164a4492d7ae2'
FIT_PLUGIN_CONFIGURATION_UNLOAD_FIT_ID = 'db2cec0cd7e5b04ae9c4d693f1cfc19a'
FIT_PLUGIN_CONFIGURATION_UPDATE_GEN_ID = 'db13514c96f8452c867c0f3e0f4553c0'
FIT_PLUGIN_CONFIGURATION_UPDATE_FIT_ID = 'ba86a03b910c48a4b34c7b2193918131'

# runtime
RUNTIME_SHUTDOWN_GEN_ID = '31a967c550a74eac837d47b09f2c5ff6'
RUNTIME_SHUTDOWN_FIT_ID = 'aa9d3684cc4640fe8e28d97fa22d8899'
RUNTIME_STATE_UPDATE_GEN_ID = 'a9f026b6fe1948859a4045afc4e84a8e'
RUNTIME_STATUS_UPDATE_FIT_ID = '56f7969c2ff44580aa882b092ac7e752'
RUNTIME_GET_STATUS_GEN_ID = 'ed4aae23aed54f73b30099adc8bb47b0'
RUNTIME_GET_STATUS_FIT_ID = '45fb2970b2424269987811a37b90627a'
RUNTIME_GET_SUB_STATUS_GEN_ID = 'abf944c2d82f401f82a7fc4be6e52c04'
RUNTIME_GET_SUB_STATUS_FIT_ID = '45dbe82199d9412281083d96627d0192'
RUNTIME_GET_WORKER_ID_GEN_ID = 'b6b86a720ec4490f83767b29e0850ee3'
RUNTIME_GET_WORKER_ID_FIT_ID = '316b300f95c24830a763cefda9076fa9'
RUNTIME_GET_WORKER_INSTANCE_ID_GEN_ID = 'b6b86720f80ec467b249a379e0850ee3'
RUNTIME_GET_WORKER_INSTANCE_ID_FIT_ID = 'da90768316b300f95c2430a763ceffa9'
RUNTIME_TRACE_LOGGER_GEN_ID = '395fcc31872c42c7964ffa7b902dbad9'
RUNTIME_TRACE_LOGGER_FIT_ID = 'a404296e63f24002a6e7befe3a3a38d4'

# service db
SERVICE_DB_REGISTER_PLUGIN_GEN_ID = '9a6f0c112c75427e843be426a6669a8f'
SERVICE_DB_REGISTER_PLUGIN_FIT_ID = '65251f4b0cc54396bef258c4531a55f6'

SERVICE_DB_UNREGISTER_PLUGIN_GEN_ID = '9a6427669843a8f0cbe1e426a612c75f'
SERVICE_DB_UNREGISTER_PLUGIN_FIT_ID = '4b0cef5f6652525c54396b8c4531a51f'

SERVICE_DB_IS_PLUGIN_EXISTED_GEN_ID = 'de7d43d229474613a50735808db82d06'
SERVICE_DB_IS_PLUGIN_EXISTED_FIT_ID = '52aee5f75260470eb0d1a740a34fe24c'

SERVICE_DB_REGISTER_TO_PLUGIN_GEN_ID = '9864131b38ac4fd988d61ee87322f3a2'
SERVICE_DB_REGISTER_TO_PLUGIN_FIT_ID = '1bbaa2b0e72940dfb39bf191626af80d'

SERVICE_DB_REMOVE_PLUGIN_FITABLES_GEN_ID = 'c4f7322f31ee9864d988d6131b38a8a2'
SERVICE_DB_REMOVE_PLUGIN_FITABLES_FIT_ID = '126af80aa2b040dfb3be729b19169bfd'

SERVICE_DB_REGISTER_EXPOSED_SERVER_GEN_ID = '42116e63eb5f4401a4bec6c325c8d002'
SERVICE_DB_REGISTER_EXPOSED_SERVER_FIT_ID = '1bbaa2b0e72940dfb39bf191626af80d'

SERVICE_DB_UNREGISTER_SERVER_GEN_ID = 'c0b316005aaa4d65b23ba56da9eb5f47'
SERVICE_DB_UNREGISTER_SERVER_FIT_ID = '8c860597aec4425bad0d357bac4a21a6'

SERVICE_DB_GET_REGISTER_SERVER_GEN_ID = '9febcaa2441a49d6b70399164545629b'
SERVICE_DB_GET_REGISTER_SERVER_FIT_ID = '98a51faf6c714524bd36b97168fa1dfd'

SERVICE_DB_GET_ALL_ADDRESS_GEN_ID = '20f72ca1acca487aa7627d092350ca3e'
SERVICE_DB_GET_ALL_ADDRESS_FIT_ID = 'e66e9a01900942898f66d11fedc1f27b'

SERVICE_DB_REGISTER_CLIENT_GEN_ID = '3854c7d8383944158b45f2b180f3438d'
SERVICE_DB_REGISTER_CLIENT_FIT_ID = 'ae3db9bb1af449f0b705323d153d441d'

SERVICE_DB_UNREGISTER_CLIENT_GEN_ID = '788b1791e0d74c118b114b9ceb9d5745'
SERVICE_DB_UNREGISTER_CLIENT_FIT_ID = 'afa4b83975d4450194f6563e49562eaf'

SERVICE_DB_GET_REGISTER_CLIENTS_GEN_ID = '33856257af234c3697691eb90fb7f1c7'
SERVICE_DB_GET_REGISTER_CLIENTS_FIT_ID = '28d47b429de54dcb92679798c9056428'

SERVICE_DB_REGISTER_FORMAT_GEN_ID = 'eaa90a47e6c547a5ae933ec487ca0b5e'
SERVICE_DB_REGISTER_FORMAT_FIT_ID = 'b1a40a5ee397431a96f4735987261e79'

SERVICE_DB_GET_REGISTER_FORMATS_GEN_ID = 'de1fee6acce34a5fa8b7f67a8a488153'
SERVICE_DB_GET_REGISTER_FORMATS_FIT_ID = '2b48cab38bbe437cbcc2834f87ff7126'

SERVICE_DB_FITABLE_SERVICES_READY_GEN_ID = 'ca0e7766bbbd4cd9b3b878e090fb0c0b'
SERVICE_DB_FITABLE_SERVICES_READY_FIT_ID = '5a202d22edd245108310c3173b39ce3f'

SERVICE_DB_GET_FIT_FFP_ALIAS_GEN_ID = '0618be85398b4fd5a3ae5061057d47fe'
SERVICE_DB_GET_FIT_FFP_ALIAS_FIT_ID = '17dffcae94d049689bae73813b5b2797'

SERVICE_DB_GET_GENERICABLE_TAGS_GEN_ID = 'ed20241bd08c406aafbe14e0e24d1310'
SERVICE_DB_GET_GENERICABLE_TAGS_FIT_ID = 'beaebb9736a246c491f559bbbafbc199'

SERVICE_DB_GET_FITABLE_UUID_BY_ALIAS_GEN_ID = 'dc177d9433054c7696021e28a3026736'
SERVICE_DB_GET_FITABLE_UUID_BY_ALIAS_FIT_ID = '4ee1f0c162984b62bdc818d11de7b6e7'

GET_ALL_FITABLES_FROM_CONFIG_GEN_ID = 'd03027af60824a05a431450ab28e6513'
GET_ALL_FITABLES_FROM_CONFIG_FIT_ID = '1ad8146585bc42cea47b3c905ae3c702'

SERVICE_DB_GET_GENERICABLE_NAME_GEN_ID = 'bf8481d27bf34cdc9d7db863a102a5e2'
SERVICE_DB_GET_GENERICABLE_NAME_FIT_ID = '01e4a58849d54004bd72358c4087c7f7'

SERVICE_DB_GET_GENERICABLE_RULE_GEN_ID = '6a0dd42dafd04d2bb076fba076f9e079'
SERVICE_DB_GET_GENERICABLE_RULE_FIT_ID = '54435ae3e2744acc879449a64a5fe8a0'

SERVICE_DB_REGISTER_ALL_FIT_SERVICE_GEN_ID = 'd4fa2004124c43858cae9c46c5388532'
SERVICE_DB_REGISTER_ALL_FIT_SERVICE_FIT_ID = '46005bf8f1bc468e9f40faf5cc5d33db'

SERVICE_DB_DOWNLOAD_AND_SUBSCRIBE_ALL_CONF_GEN_ID = 'a6a73e331803447b8e9d164717580870'
SERVICE_DB_DOWNLOAD_AND_SUBSCRIBE_ALL_CONF_FIT_ID = '0cb85d99c4524f119d2279c1e8a8bdb7'

SERVICE_DB_GET_PLUGIN_CONF_PATH_GEN_ID = '8ed799c77f6e422a96b7c2895a814851'
SERVICE_DB_GET_PLUGIN_CONF_PATH_FIT_ID = '5ca58c3c03a7499dbdb34ed7914087bb'

SERVICE_DB_GET_CONF_KEY_BY_PATH_GEN_ID = 'b277b116c4ae47cca6d0ecadba900234'
SERVICE_DB_GET_CONF_KEY_BY_PATH_FIT_ID = '62f1038b454d473cbf1965b07f37c0e2'

# heartbeat client
ONLINE_HEART_BEAT_GEN_ID = 'bf2e1029e8844fe9afb698affb95d39c'
ONLINE_HEART_BEAT_FIT_ID = '6bd00d54d5684a0480cb567a058210f7'
CM_ONLINE_HEART_BEAT_FIT_ID = 'CM_ONLINE_HEART_BEAT_FIT_ID'
HEART_BEAT_EXIT_UNEXPECTEDLY_GEN_ID = 'HEART_BEAT_EXIT_UNEXPECTEDLY_GEN_ID'
HEART_BEAT_EXIT_UNEXPECTEDLY_FIT_ID = 'HEART_BEAT_EXIT_UNEXPECTEDLY_FIT_ID'

# register client
GET_FIT_SERVICE_ADDRESS_LIST_GEN_ID = '564286f7db6349b2b29db49feac3b7da'
GET_FIT_SERVICE_ADDRESS_LIST_FITABLE_ID = '9602150ac5694585ab9a9e3d7561f48b'

NOTIFY_FIT_SERVICE_GEN_ID = 'modelengine.fit.service.registry-listener.notify-fitables'
NOTIFY_FIT_SERVICE_FITABLE_ID = 'NOTIFY_FIT_SERVICE_FITABLE_ID'

ONLINE_FIT_SERVICE_GEN_ID = '2ac926e6e40245b78b7bdda23bcb727b'
ONLINE_FIT_SERVICE_FITABLE_ID = 'ONLINE_FIT_SERVICE_FITABLE_ID'

OFFLINE_FIT_SERVICE_FITABLE_ID = 'd4b42ada0f744441a8b1eca9f2919a8a'

GET_FITABLES_OF_GENERICABLE_GEN_ID = 'GET_FITABLES_OF_GENERICABLE_GEN_ID'
GET_FITABLES_OF_GENERICABLE_FIT_ID = 'GET_FITABLES_OF_GENERICABLE_FIT_ID'

MARK_ADDRESS_STATUS_GEN_ID = 'e5f5a8809c534d21a6639e0e1ae2ccae'
MARK_ADDRESS_STATUS_FITABLE_ID = '711de8c45e3d498b885801b5bc7394ad'

# configuration center agent
CONFIGURATION_AGENT_DOWNLOAD_GEN_ID = '918fbf55d64b4de8910d08cfcb41d31c'
CONFIGURATION_AGENT_DOWNLOAD_FIT_ID = 'ef64c99ddeeb48259e10828bc62c211f'

CONFIGURATION_AGENT_UPLOAD_GEN_ID = '90c52daf8cc14e22ad8cfb9a19d21157'
CONFIGURATION_AGENT_UPLOAD_FIT_ID = 'CONFIGURATION_AGENT_UPLOAD_FIT_ID'

# fit server
FIT_SERVER_START_GEN_ID = '9289a2a4322d47d38f33fc32c47f04d2'
FIT_SERVER_START_HTTP_FITABLE_ID = '911533a440e541a2900da06e01d3e6de'
FIT_SERVER_START_GRPC_FITABLE_ID = '8f1e46e8a25a4ed391cb115b766d76db'
FIT_SERVER_START_UC_FITABLE_ID = 'FIT_SERVER_START_UC_FITABLE_ID'

FIT_SERVER_STOP_GEN_ID = '1b9bfc4a2b2141d5b31aa06791d645b4'
FIT_SERVER_STOP_HTTP_FITABLE_ID = '2f661c07515f43cf802e30f7d81efbae'
FIT_SERVER_STOP_GRPC_FITABLE_ID = '0970e120501047fa800078edd7437fa4'
FIT_SERVER_STOP_UC_FITABLE_ID = 'FIT_SERVER_STOP_UC_FITABLE_ID'

FIT_ON_APPLICATION_STARTED_GEN_ID = 'd45f8ecbfb9c4d11a38143233c878a8f'

# load balancer python
LOAD_BALANCING_GEN_ID = '9046fe29c2a947448d86bf8178c745e1'
LOAD_BALANCING_RANDOM_FIT_ID = 'c5fcfc2cd8b54fa6940ad8ef67f257b4'
LOAD_BALANCING_ROUND_ROBIN_FIT_ID = 'b5a97c8f656143ebb84f8237c26b6195'

LOAD_BALANCING_FILTER_GEN_ID = 'd58a444c9cd546b5b284353c0326209c'
LOAD_BALANCING_FILTER_FIT_ID = '8a67f9e84e7e4077897a9b615c067dd4'

# http/grpc client
REQUEST_RESPONSE_GEN_ID = '887837e5d33f4fdfa76b05c75458fa0c'
REQUEST_RESPONSE_ROUTE_FITABLE_ID = 'b0d8a8e116a34f1b8e45ce2be8dde6b9'
HTTP_REQUEST_RESPONSE_FITABLE_ID = 'c69ed4bef81542848c6f11a0a499a09a'
GRPC_REQUEST_RESPONSE_FITABLE_ID = 'f65a67f554a243cc8a89e60b2a3e5ba0'
UC_REQUEST_RESPONSE_FITABLE_ID = 'UC_REQUEST_RESPONSE_FITABLE_ID'
HTTPS_REQUEST_RESPONSE_FITABLE_ID = 'HTTPS_REQUEST_RESPONSE_FITABLE_ID'

# server
SERVER_RESPONSE_GEN_ID = '63ee92ae39c54ee7a529460e29aee542'
SERVER_RESPONSE_FIT_ID = '25827389e64248f1807a015118509326'

# gateway
GENERIC_PROXY_ROUTING_GEN_ID = 'GENERIC_PROXY_ROUTING_GEN_ID'
GENERIC_PROXY_DOWNLOAD_GEN_ID = 'GENERIC_PROXY_DOWNLOAD_GEN_ID'
GENERIC_PROXY_UPLOAD_GEN_ID = 'GENERIC_PROXY_UPLOAD_GEN_ID'

# external interfaces
# configuration center
FIT_CONFIGURATION_SERVER_DOWNLOAD_GEN_ID = '4c0e733d04e94f488c122925052aceb1'
FIT_CONFIGURATION_SERVER_APPEND_SUBSCRIPTION_GEN_ID = 'fd059427d2b742f590533ea95391144a'
FIT_CONFIGURATION_SERVER_REMOVE_SUBSCRIPTION_GEN_ID = '01c48f78a6964f4392d026df694b33e5'

FIT_CONFIGURATION_SERVER_UPLOAD_GEN_ID = 'ae024f34dd7a4dc88e19a1a8cf801f29'
FIT_CONFIGURATION_SERVER_UPLOAD_FIT_ID = '2ae9d88f46894f7bb0fcd45cf544cb52'

# registry server
QUERY_FIT_SERVICE_GEN_ID = 'modelengine.fit.registry.registry-service.query-fitables-addresses'
QUERY_FIT_SERVICE_FIT_ID = 'query-fitables-addresses'
SUBSCRIBE_FIT_SERVICE_GEN_ID = 'modelengine.fit.registry.registry-service.subscribe-fitables'
SUBSCRIBE_FIT_SERVICE_FIT_ID = 'subscribe-fitables'
UNSUBSCRIBE_FIT_SERVICE_GEN_ID = 'modelengine.fit.registry.registry-service.unsubscribe-fitables'
UNSUBSCRIBE_FIT_SERVICE_FIT_ID = 'unsubscribe-fitables'
REGISTER_FIT_SERVICE_GEN_ID = 'modelengine.fit.registry.registry-service.register-fitables'
REGISTER_FIT_SERVICE_FIT_ID = 'register-fitables'
UNREGISTER_FIT_SERVICE_GEN_ID = 'modelengine.fit.registry.registry-service.unregister-fitables'
UNREGISTER_FIT_SERVICE_FIT_ID = 'unregister-fitables'
QUERY_FITABLE_METAS_GEN_ID = 'modelengine.fit.registry.registry-service.query-running-fitables'
QUERY_FITABLE_METAS_FIT_ID = 'query-running-fitables'

# heartbeat server
SEND_HEART_BEAT_GEN_ID = 'modelengine.fit.heartbeat.send-heartbeat'
SEND_HEART_BEAT_FIT_ID = 'send-heartbeat'
STOP_HEART_BEAT_GEN_ID = 'modelengine.fit.heartbeat.stop-heartbeat'
STOP_HEART_BEAT_FIT_ID = 'stop-heartbeat'

# debugger
DEBUGGER_START_FIT_ID = 'debugger_start_fitable_id'
DEBUGGER_START_GEN_ID = 'debugger_start_gen_id'
DEBUGGER_REQUEST_GEN_ID = 'debugger_request_gen_id'
DEBUGGER_REQUEST_FITABLE_ID = 'debugger_request_fitable_id'

# recycle
RECYCLE_GEN_ID = '782eed4bb8ed4867a67d66894719ad09'
RECYCLE_FITABLE_ID = '37210e40e78c46beb148a05b99d6fd72'

# rule engine
RULE_ENGINE_EXECUTE_GEN_ID = 'f54d01848ca146d7aa450afe77027ddf'
RESOLVE_TAGS_GEN_ID = '41151994d1e74245ad1416b75c8eff39'

# dynamic loading
DYNAMIC_LOADING_START_GEN_ID = '1f54daa450848ca1e77027dd46d70aff'
DYNAMIC_LOADING_START_FIT_ID = 'd14167424b75c8eff351994d1e5a4119'
